package com.sq.partner.manager.dao;

import java.util.List;
import java.util.Map;

import com.sq.partner.manager.mybatis.model.NlifePlan;
import com.sq.partner.manager.mybatis.model.NlifeProd;
import com.sq.partner.manager.mybatis.model.TradAgentInfo;
import com.sq.partner.manager.mybatis.model.TradAgentInfoRela;
import com.sq.partner.manager.util.Page;


/**
 * 新意健险方案
 * @author Mango
 *
 */
public interface INlifePlanDao extends BaseDao{
	
	/**
	 * 分页条件查询
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<Map<String,Object>> queryPageByCriteria(Page<Map<String,Object>> page) throws Exception;
	
	/**
	 * 分页条件查询健康告知
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<Map<String,Object>> queryNlifeHealthInformPageByCriteria(Page<Map<String,Object>> page) throws Exception;
	
	/**
	 * 分页新条件查询
	 * @param page
	 * @return
	 */
	public Page<Map<String, Object>> queryPageByNewCriteria(
			Page<Map<String, Object>> page) throws Exception;
	
	/**
	 * 根据planNo查询对应方案
	 * @param planNo
	 * @return
	 * @throws Exception
	 */
	public NlifePlan queryById(String planNo) throws Exception;

	/**
	 * 根据planNo删除对应方案
	 * @param planNo
	 * @return
	 * @throws Exception
	 */
	public boolean delById(String planNo) throws Exception;
	
	/**
	 * planStr  规则前缀  
	 * 查询下一个planNo(生成规则：ZHA+00001(5位流水号递增))
	 * @return
	 * @throws Exception
	 */
	public String queryNextPlanNo(String planStr) throws Exception;
	
	/**
	 * 新增方案，参数中不需传operTime(操作时间)，在该方法实现中为operTime赋值
	 * @param nlifePlan
	 * @return
	 * @throws Exception
	 */
	public boolean add(NlifePlan nlifePlan) throws Exception;
	
	/**
	 * 更新方案，参数中不需传operTime(操作时间)，在该方法实现中为operTime赋值
	 * @param nlifePlan
	 * @return
	 * @throws Exception
	 */
	public boolean update(NlifePlan nlifePlan) throws Exception;
	
	public boolean updateForCheck(NlifePlan nlifePlan) throws Exception;
	
	public List<NlifePlan> queryPartnerInfoByProdCode(String prodCode) throws Exception;

	//删除合作伙伴时校验是否关联方案
	public boolean isHasExistNlifePlan(String partnerNo) throws Exception;

	public List<TradAgentInfo> searchTradAgentInfosByplanCode(
			Map<String, Object> maps) throws Exception;

	public List<TradAgentInfoRela> searchTradAgentInfoRelasByplanCode(
			Map<String, Object> maps) throws Exception;
	
	/**导出方案查询*/
	public List<Map<String, Object>> impNlifePlan(Map<String, Object>map) throws Exception;

//	/**
//	 * 查询方案信息列表
//	 * @param name
//	 * @return
//	 * @throws Exception
//	 */
//	public List<NlifePlan> queryPlanList(String name, String channelCode) throws Exception;
	
	/**
	 * 激活卡方案分页条件查询
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<NlifePlan> queryPageByCriteriaForCard(Map<String,Object>map) throws Exception;
	/**
	 * 激活卡方案总条数
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public Integer queryCountByCriteriaForCard(Map<String,Object>map)throws Exception;

	public boolean isHealthInformExist(String coreProdCode) throws Exception;
	
	public void  insertNewHealthInform(Map<String,Object> map) throws Exception;
	
	/**
	 * 删除已有健康告知
	 * @param id
	 * @throws Exception
	 */
	public void delNlifeHealthInform(String id )throws Exception;
}
